package com.glodon.paas.document.dao.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.glodon.paas.document.dao.domain.ShareEntity;

public interface ShareEntityMapper {

    int deleteByPrimaryKey(String id);

    int insert(ShareEntity record);

    int insertSelective(ShareEntity record);

    ShareEntity selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(ShareEntity record);

    int updateByPrimaryKey(ShareEntity record);

    List<ShareEntity> selectShareForMe(@Param("userId")
    String userId, @Param("fileId")
    String fileId, @Param("shareType")
    Integer shareType, @Param("startIndex")
    int startIndex, @Param("count")
    int count);

    List<ShareEntity> selectShareByMe(@Param("userId")
    String userId, @Param("fileId")
    String fileId, @Param("shareType")
    Integer shareType, @Param("startIndex")
    int startIndex, @Param("count")
    int count);

    // 查找被共享的任意文件的id，用于判断该文件是否被共享
    // String selectAnyShareIdByFileId(@Param("fileId")String fileId, @Param("excludeUserId")String excludeUserId);

    int deleteByFileId(@Param("fileId")
    String fileId, @Param("shareType")
    Integer shareType);

    int deleteByOwnerId(String ownerId);

    long countBySelective(Map<String, Object> param);
}
